﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;

public class SimpleItem_TowSprite:InteractiveItems
{
    [SerializeField] protected Sprite activeSprite, unActiveSprite;
    [SerializeField] protected SpriteRenderer spriteRenderer;
    [SerializeField] protected bool isActive = false;

    protected override void Awake()
    {
        base.Awake();
        if (isActive)
        {
            Active();
        }
        else
        {
            UnActive();
        }
    }

    public override void Interactive()
    {
        base.Interactive();
        if (isActive)
        { 
            UnActive();
        }
        else
        {
            Active();
        }
    }

    protected virtual void Active()
    {
        spriteRenderer.sprite = activeSprite;
        isActive = true;
    }
    
    protected virtual void UnActive()
    {
        spriteRenderer.sprite = unActiveSprite;
        isActive = false;
    }
}
